<template>
    <el-menu
      :default-active="'/index'"
      router
      mode="horizontal"
      background-color="white"
      text-color="white"
      active-text-color="#409EFF"
      style="min-width: 1300px"
      v-if="falg"
    >
      <el-menu-item v-for="(item, i) in navList" :key="i" :index="item.name">
        {{ item.navItem }}
      </el-menu-item>
  
      <a
        href="#nowhere"
        @click="drawer = true"
        type="primary"
        style="color: white; float: right; padding: 20px"
        >设置</a
      >
      <i
        class="el-icon-menu"
        style="float: right; font-size: 45px; color: #222; padding-top: 8px"
      ></i>
      <el-drawer
        title="个人设置"
        
        :direction="direction"
        :before-close="handleClose"
      >
        <div @click="recover">
          <span>
            <el-avatar :src="cover" @click="getusername" :size="100"></el-avatar>
          </span>
        </div>
  
        <div @click="reusername">
          <p>用户姓名：{{ username }}</p>
        </div>
  
        <!-- <div>
          <el-button type="primary" round @click="changpassword">修改用户名</el-button>
        </div> -->
        <div>
          <el-switch v-model="value1" inactive-text="声音"> </el-switch>
        </div>
        <div>
          <el-button
            type="primary"
            class="xiugaimima"
            plain
            @click="changpassword"
            >修改密码</el-button
          >
        </div>
  
        <el-button type="primary" class="tuichudenglu" plain v-on:click="finish"
          >退出登录</el-button
        >
  
        <div>
          <el-button
            type="primary"
            class="zhuxiaozhanghao"
            plain
            v-on:click="destory"
            >注销账号</el-button
          >
        </div>
  
        <div class="pingjia">
          <span class="demonstration">感谢支持,来评价一下我们吧！</span>
          <el-rate v-model="value2" :colors="colors" show-text> </el-rate>
        </div>
      </el-drawer>
      <span
        style="
          position: absolute;
          padding-top: 20px;
          right: 43%;
          font-size: 20px;
          font-weight: bold;
          color: aliceblue;
        "
        >Lcz - Your Mind Palace</span
      >
      <ResueName ref="reu"></ResueName>
      <Recover ref="rec"></Recover>
    </el-menu>
  </template>
  <script>
export default {
    name: "LastNavMenu",
    indect: ["reload"],
    data() {
        return {
            navList: [
                { name: "/lastindex", navItem: "图书详情库" },
                { name: "/jotter", navItem: "笔记本" },
                { name: "/orderpage", navItem: "图书订单库" },
                { name: "/customerpage", navItem: "客户表" },
            ],
            value1: true,
            drawer: false,
            direction: "rtl",
            username: "",
            cover: "",
            falg: false,
            busdata: "",
            value2: null,
            colors: ["#99A9BF", "#F7BA2A", "#FF9900"], // 等同于 { 2: '#99A9BF', 4: { value: '#F7BA2A', excluded: true }, 5: '#FF9900' }
        };
    },
    created() {
        this.busdata = sessionStorage.getItem("busdata");
    console.log("lastnav this.busdata:"+this.busdata);
    if (this.busdata == 200) {
      this.falg = false;
    }else if (this.busdata == 201) {
      this.falg = true;
    }
    console.log(this.falg);
  },
}

  </script>
  <style scoped>
  a {
  text-decoration: none;
}

span {
  pointer-events: none;
}
.pingjia {
  position: absolute;
  margin-top: 595px;
  margin-left: 150px;
}
.exit-account {
  position: absolute;
  margin-top: 532px;
  margin-left: -39px;
}
/* button.el-button.el-button--primary.is-round {
    position: absolute;
  
    margin-top: 470px;
      margin-left: -41px;
  
  } */
.xiugaimima {
  position: absolute;
  margin-top: 426px;
  margin-left: -39px;
}
.el-icon-switch-button {
  position: absolute;
  margin-left: 300px;
}
.tuichudenglu {
  position: absolute;
  margin-left: -40px;
  margin-top: 478px;
}
.zhuxiaozhanghao {
  position: absolute;
  margin-left: -38px;
  margin-top: 531px;
}
.el-menu {
  width: 100%;
    position: relative;
    /* margin-top: 0.1%; */
    /* margin-top: 8px; */
    height: 12%;
    margin-left: 0px;
    background-image: url(/src/assets/eva.jpg);
    display: block;
    margin: 0%;
    padding: 0%;
}
  </style>
 